import java.util.Scanner;

public class L06 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] arr=new int[6];
        System.out.println("欢迎各位评委开始打分");
        for (int i = 0; i < 6; i++) {


            int fs=sc.nextInt();
            if(fs>=1 && fs<=100){
                arr[i]=fs;
            }else{
                System.out.println("输入有误");
                i--;
            }
        }
        int max=arr[0];
        for (int i = 0; i <arr.length; i++) {
            if (arr[i]>max) {
                max=arr[i];
            }
        }
        int min=arr[0];
        for (int i = 0; i < arr.length; i++) {
           if(arr[i]<min) {
               min=arr[i];
           }
        }
         int sum=0;
        for (int i = 0; i < arr.length ; i++) {
            sum+=arr[i];
        }
          int avg=(sum-max-min)/4;
        System.out.println(avg);

    }

}
